﻿@model UA.Framework.Views.UpdatePwdView
@{
    ViewBag.Title = "UpdatePwd";
}

<h2>修改密码 - UpdatePwd</h2>
<hr />
@section Header {
    <script type="text/javascript">
        $(function () {
            $("#updatePwdForm").submit(function () {
                var validate = $(this).form("validate");
                if (validate) {
                    var pwd = $("#Password"), newPwd = $("#NewPassword"), newPwdConfirm = $("#NewPasswordConfirm");
                    if (newPwd.val() != newPwdConfirm.val()) {
                        $.messager.show({ title: "操作提醒", msg: "两次输入的新密码不一致，请重新输入！" });
                        newPwd.focus();
                        return false;
                    }
                    if (pwd.val() == newPwd.val()) {
                        $.messager.show({ title: "操作提醒", msg: "新旧密码不能一样，请重新输入！" });
                        newPwd.focus();
                        return false;
                    }
                    return true;
                }
            });
        });
    </script>
}
<div class="easyui-panel" data-options="title: '修改密码', width: 400, height: 280, left: 80, top: 100, collapsible: true">
    @using (@Html.BeginForm("UpdatePwd", "Account", FormMethod.Post, new { id = "updatePwdForm", @class = "edit-form" }))
    {
        @Html.AntiForgeryToken()
        <p>
            @Html.LabelFor(m => m.Password)
            @Html.PasswordFor(m => m.Password, new Dictionary<string, object>() { { "class", "easyui-textbox" }, { "data-options", "required: true, validType: 'length[1, 32]'" } })
        </p>
        <p>
            @Html.LabelFor(m => m.NewPassword)
            @Html.PasswordFor(m => m.NewPassword, new Dictionary<string, object>() { { "class", "easyui-textbox" }, { "data-options", "required: true, validType: 'length[1, 32]'" } })
        </p>
        <p>
            @Html.LabelFor(m => m.NewPasswordConfirm)
            @Html.PasswordFor(m => m.NewPasswordConfirm, new Dictionary<string, object>() { { "class", "easyui-textbox" }, { "data-options", "required: true, validType: 'length[1, 32]'" } })
        </p>
        <hr />
        <p>
            <input class="submit" type="button" value="确定" />
            <input class="reset" type="button" value="重置" />
            <input class="cancel" type="button" value="取消" />
        </p>
    }
</div>
